<template>
  <div id="centreLeft1">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span style="color:#5cd9e8">
          <icon name="chart-bar"></icon>
        </span>
        <div class="d-flex">
          <!-- <span class="fs-xl text mx-2">任务通过率</span> -->
          <dv-decoration-3 style="width:1.25rem;height:.25rem; position:relative;top:-.0375rem;" />   
        </div>
      </div>
      <div style="padding:0.3rem ">
        <dv-scroll-board :config="config" ref="scroll-board" style="width:8.675rem;height:4.98rem" />
      </div>
    </div>
  </div>
</template>

<script>
// import centreLeft1Chart from "@/components/echart/centerLeft2/centreLeft1Chart";
export default {
  data() {
    return {
      config: {
        header: ['地区', '店铺', '单价' ,'时间'],
        data: [
        ["遵义", "探花海（汇川一店）",          "<span  class='colorRed'>35.68元</span>",'刚刚'],
          ["长沙", "探花海（新时代广场百货店）", "<span  class='colorRed'>46.32元</span>",'3分钟前'],
          ["广州", "探花海（聚金园二街百货店）", "<span  class='colorRed'>18.67元</span>",'5分钟前'],
          ["潍坊", "探花海（城市广场店）",      "<span  class='colorRed'>23.56元</span>",'刚刚'],
          ["长春", "探花海（红旗街百货店）",     "<span  class='colorRed'>125.36元</span>",'刚刚'],
          ["深圳", "爱联祥云探花海",            "<span  class='colorRed'>26.39元</span>",'刚刚'],
          ["长沙", "星城国际探花海",            "<span  class='colorRed'>41.98元</span>",'2分钟前'],
          ["东营", "天顺隆探花海",              "<span  class='colorRed'>68.12元</span>",'刚刚'],
          ["东营", "润丰探花海",                "<span  class='colorRed'>53.26元</span>",'刚刚'],
          ["济南", "探花海（科院路百货店）",     "<span  class='colorRed'>42.36元</span>",'1分钟前'],
          ["济南", "佛山街探花海",              "<span  class='colorRed'>29.58元</span>",'刚刚'],
          ["济南", "九爷百货",                  "<span  class='colorRed'>23.98元</span>",'刚刚'],
          ["济南", "美团-嬉趣阁",               "<span  class='colorRed'>98.36元</span>",'4分钟前'],
          ["长春", "探花海·新零售（北胡同店）",   "<span  class='colorRed'>78.45元</span>",'刚刚'],
          ["长春", "爱沐成人用品店（长春探花海）", "<span  class='colorRed'>65.36元</span>",'3分钟前']
        ],
        rowNum: 6, //表格行数
        headerHeight: 35,
        headerBGC: "#0f1325", //表头
        oddRowBGC: "#0f1325", //奇数行
        evenRowBGC: "#171c33", //偶数行
        waitTime: 8000,
        columnWidth: [50],
        align: ["center"]
      },
      numberData: [
        {
          number: {
            number: [15],
            toFixed: 1,
            content: "{nt}"
          },
          text: "今日构建总量"
        },
        {
          number: {
            number: [1144],
            toFixed: 1,
            content: "{nt}"
          },
          text: "总共完成数量"
        },
        {
          number: {
            number: [361],
            toFixed: 1,
            content: "{nt}"
          },
          text: "正在编译数量"
        },
        {
          number: {
            number: [157],
            toFixed: 1,
            content: "{nt}"
          },
          text: "未通过数量"
        }
      ]
    };
  },
  components: {
    // centreLeft1Chart
  },
  mounted() {
    
    this.changeTiming();
    // this.changeNumber()
  },
  methods: {
    changeTiming() {
      setInterval(() => {
        this.changeNumber();
      }, 60000);
    },
    changeNumber() {
      const min = 20;
      const max = 110;
      var data = [];
      this.config.data.forEach(el => {
         let randomNum = (min + Math.random() * (max - min)).toFixed(2);
          el[2]=`<span  class='colorRed'>${randomNum}元</span>`
          data.push(el)
        });
        this.$refs['scroll-board'].updateRows(data)
        console.log(this.config.data)
    }
  }
};
</script>

<style lang="scss">
#centreLeft1 {
  padding: 0.2rem;
  height: 5.125rem;
  min-width: 3.75rem;
  border-radius: 0.0625rem;
  .bg-color-black {
    height: 4.8125rem;
    border-radius: 0.125rem;
  }
  .text {
    color: #c3cbde;
  }
  .chart-box {
    margin-top: 0.2rem;
    width: 2.125rem;
    height: 2.125rem;
    .active-ring-name {
      padding-top: 0.125rem;
    }
  }

  .bottom-data {
    .item-box {
      float: right;
      position: relative;
      width: 50%;
      color: #d3d6dd;
      // 金币
      .coin {
        position: absolute;
        left: 0.1rem;
        top: 0.2125rem;
        font-size: 0.25rem;
        color: #ffc107;
      }
      .colorYellow {
        color: yellowgreen;
      }
    }
  }
}
</style>